﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using OnlineBookReader;

namespace Reader.View
{
    [Sample("本地图书", "localBook")]
    public partial class BoolListView : UserControl
    {
        public BoolListView()
        {
            InitializeComponent();
            
        }
        public BoolListView(string uri)
            : this()
        {
            Uri = uri;
        }
        string Uri;
        public void LoadBook()
        {
            ReaderConfig.IsUseLoaclBook = true;
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            if (App.Current.IsRunningOutOfBrowser)
            {
                IList<BookLocation> books = LocalBookConfig.LoaclBook.GetBook();
                listBox1.DataContext = books;
            }
        }
        private void HyperlinkButton_Click(object sender, RoutedEventArgs e)
        {
            HyperlinkButton hb = e.OriginalSource as HyperlinkButton;
            SampleBrowser.Current.PopulateSamplesTab("bookpage", hb.CommandParameter.ToString());
        }
    }
}
